package com.kclmedu.feign.controller;

import com.kclmedu.feign.service.ScheduleServiceHi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/*************************
 *@ClassName HiFeignController
 *@Description 在此控制器，直接注入 Feign 定义的接口
 *@Author yejf
 *@Date 2019-12-01 22:46
 *@Version 1.0
 */
@RestController
public class HiFeignController {

    @Autowired
    private ScheduleServiceHi serviceHi;

    @RequestMapping("/hello")
    public String hiFeign(@RequestParam String name) {
        //直接调用注入的接口对象【此对象是通过 Feign 注解过的】
        System.out.println("-- 在FeignController中...");
        return serviceHi.responseFromClientHi(name);
    }
}
